<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2023/12/31
  Time: 11:26
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
    <head>
        <title>学生选课页面</title>
        <style>
            /* 在此添加你的CSS 样式 */
            table {
                width: 100%;
                border-collapse: collapse;
            }
            th, td {
                padding: 8px;
                text-align: left;
                border-bottom: 1px solid #ddd;
            }
            tr:hover {
                background-color: #f5f5f5;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <h2>选课表</h2>
            <table>
                <thead>
                <tr>
                    <th>课程号</th>
                    <th>课程名称</th>
                    <th>学时</th>
                    <th>教师号</th>
                    <th>考核方式</th>
                    <th>学分</th>
                    <th>选择</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${courses}" var="course">
                    <tr>
                        <td>${course.course_id}</td>
                        <td>${course.course_name}</td>
                        <td>${course.hour}</td>
                        <td>${course.teacher_id}</td>
                        <td>${course.method}</td>
                        <td>${course.credits}</td>
                        <td>
                            <form action="/insertCourse" method="post">
                                <input type="hidden" name="course_id" value="${course.course_id}" />
                                <input type="hidden" name="course_name" value="${course.course_name}" />
                                <input type="hidden" name="hour" value="${course.hour}" />
                                <input type="hidden" name="teacher_id" value="${course.teacher_id}" />
                                <input type="hidden" name="method" value="${course.method}" />
                                <input type="hidden" name="credits" value="${course.credits}" />
                                <input type="submit" value="选择" />
                            </form>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
                <input type="button" class="button" onclick="window.location.href='studentHome'" value="返回">
            </table>
        </div>
    </body>
</html>
